﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Friend.aspx.cs" Inherits="active_WithMe_admin_Friend" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>我们约会吧后台</title>
<!--                       CSS                       -->
<!-- Reset Stylesheet -->
<link rel="stylesheet" href="resources/css/reset.css" type="text/css" media="screen" />
<!-- Main Stylesheet -->
<link rel="stylesheet" href="resources/css/style.css" type="text/css" media="screen" />
<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
<link rel="stylesheet" href="resources/css/invalid.css" type="text/css" media="screen" />
<!--                       Javascripts                       -->
 <script type="text/javascript" src="resources/scripts/jquery.js"></script>
 <script type="text/javascript" src="resources/scripts/interface.js"></script>
<script type="text/javascript">
		
	 	$(document).ready(function(){
	 		uploadcreate($("#uploadbox"));
		});
	 	
	 	var hideDiv = function(idName){
	 		$("#"+idName).fadeOut("fast");
	 	};
	 	
	 	//载入中的GIF动画
	    var loadingUrl = "resources/images/ajax-loader.gif";
	    
	    //选择文件后的事件,iframe里面调用的
	    var uploading = function(imgsrc){
	        var el = $("#uploading");
	        $("#ifUpload").fadeOut("fast");
	        el.fadeIn("fast");
		    el.html("<img src='"+loadingUrl+"' align='absmiddle' /> 上传中...");
		    return el;
	    };
	    
	    //重新上传方法    
	    var uploadinit = function(){
	        $("#uploading").fadeOut("fast",function(){
	             $("#ifUpload").fadeIn("fast");
	        });
	               
	    };
	    
	    //上传时程序发生错误时，给提示，并返回上传状态
	    var uploaderror = function(){
	        alert("程序异常，上传未成功。");
	        uploadinit();
	    };
	    
	    //上传成功后的处理
		var uploadsuccess = function(newpath){
	        $("#txtContent").html("<img src=\""+""+newpath+"\" onload=\"if(this.width>40){this.width=40;}\" />");
	        $("#HiddenContent").html("<input type='hidden' name='GirlImages' id='GirlImages' value='"+newpath+"' />");
	      	var el = $("#uploading");
			el.html("上传成功,<a href=\"javascript:void(0);\" onclick=\"uploadinit();\">[重新上传]</a>.");
	    };
	    
	    
	    //创建一个上传控件
	    var uploadcreate = function(el){
	        var strContent = "<div class='uploadcontrol'><iframe src=\"upload.aspx\" id=\"ifUpload\" frameborder=\"no\" scrolling=\"no\" style=\"width:400px; height:28px;\"></iframe>";
		    strContent += "<div class=\"uploading\" id=\"uploading\" style=\"display:none;\" ></div>";
		    strContent += "<div class=\"image\" id=\"panelViewPic\" style=\"display:none;\"></div></div>";
		    el.append(strContent);
	    };
	 	
	</script>
	<script type="text/javascript">
		
	 	$(document).ready(function(){
	 		uploadcreate2($("#uploadbox2"));
		});
	 	
	 	var hideDiv2 = function(idName){
	 		$("#"+idName).fadeOut("fast");
	 	};
	 	
	      var loadingUrl2 = "images/ajax-loader.gif";
	    //选择文件后的事件,iframe里面调用的
	    var uploading2 = function(imgsrc){
	        var el = $("#uploading2");
	        $("#ifUpload2").fadeOut("fast");
	        el.fadeIn("fast");
		    el.html("<img src='"+loadingUrl2+"' align='absmiddle' /> 上传中...");
		    return el;
	    };
	    
	    //重新上传方法    
	    var uploadinit2 = function(){
	        $("#uploading2").fadeOut("fast",function(){
	             $("#ifUpload2").fadeIn("fast");
	        });
	               
	    };
	    
	    //上传时程序发生错误时，给提示，并返回上传状态
	    var uploaderror2 = function(){
	        alert("程序异常，上传未成功。");
	        uploadinit2();
	    };
	    
	    //上传成功后的处理
		var uploadsuccess2 = function(newpath){
	        $("#txtContent2").html("<img src=\""+""+newpath+"\" onload=\"if(this.width>40){this.width=40;}\" />");
	        $("#HiddenContent2").html("<input type='hidden' name='BoyImages' id='BoyImages' value='"+newpath+"' />");
	      	var el = $("#uploading2");
			el.html("上传成功,<a href=\"javascript:void(0);\" onclick=\"uploadinit2();\">[重新上传]</a>.");
	    };
	    
	    
	    //创建一个上传控件
	    var uploadcreate2 = function(el){
	        var strContent = "<div class='uploadcontrol'><iframe src=\"upload2.aspx\" id=\"ifUpload2\" frameborder=\"no\" scrolling=\"no\" style=\"width:400px; height:28px;\"></iframe>";
		    strContent += "<div class=\"uploading\" id=\"uploading2\" style=\"display:none;\" ></div>";
		    strContent += "<div class=\"image\" id=\"panelViewPic2\" style=\"display:none;\"></div></div>";
		    el.append(strContent);
	    };
	 	
	</script>


</head>
<body>
<form id="form1" runat="server">
<div id="body-wrapper">
  <!-- Wrapper for the radial gradient background -->
  <div id="sidebar">
    <div id="sidebar-wrapper">
      <!-- Sidebar with logo and menu -->
      <h1 id="sidebar-title"><a href="#">Dote with me Admin</a></h1>
      <!-- Logo (221px wide) -->
      <a href="index.aspx"><img id="logo" src="resources/images/logo.png" alt="Dote with me Admin" /></a>
      <!-- Sidebar Profile links -->
      <div id="profile-links"> Hello, <a href="#" title="Edit your profile"><%=Session["user"].ToString() %></a>, welcome to  Admin <br />
        <br />
        <a href="../index.aspx" target="_blank" title="View the Site">View the Site</a> | <a id="A1" href="#" runat="server" onserverclick="SignOut" title="Sign Out">Sign Out</a> </div>
      <ul id="main-nav">
        <!-- Accordion Menu -->
        <li> <a href="index.aspx" class="nav-top-item no-submenu">
          <!-- Add the class "no-submenu" to menu items with no sub menu -->
          活动 </a> </li>
        <li> <a href="friend.aspx" class="nav-top-item current">
          <!-- Add the class "current" to current menu item -->
          配对 </a>
     
        </li>
       
      </ul>
      <!-- End #main-nav -->
 
    </div>
  </div>
  <!-- End #sidebar -->
  <div id="main-content">
    <!-- Main Content Section with everything -->
    <noscript>
    <!-- Show a notification if the user has disabled javascript -->
    <div class="notification error png_bg">
      <div> Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/" title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852" title="Enable Javascript in your browser">enable</a> Javascript to navigate the interface properly.
        Download From <a href="http://www.exet.tk">exet.tk</a></div>
    </div>
    </noscript>
    <!-- Page Head -->

    <!-- End .shortcut-buttons-set -->
    <div class="clear"></div>
    <!-- End .clear -->
    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>配对设置</h3>
        <ul class="content-box-tabs">
      <li><a href="#tab1" class="default-tab current" onclick="Defaule();" id="gototab1">游览</a></li>
          <!-- href must be unique and match the id of target div -->
          <li><a href="#tab2" id="gototab2" onclick="Style();" >添加</a></li>
        </ul>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
          <!-- This is the target div. id must match the href of this div's tab -->
         <%if(message=="error"){ %>
          <div class="notification attention png_bg" id="note"> <a href="#" class="close"><img src="resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" onclick="Close();" /></a>
            <div> 抱歉，更新失败，请重新尝试！</div>
          </div>
          <%}
            else if (message == "success")
            { %>
          <div class="notification success png_bg" id="note"> <a href="#" class="close"><img src="resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" onclick="Close();" /></a>
      <div> 更新成功哦! </div>
        </div>
            <%}
            else if (message == "NoComplete")
            { %>    
            <div class="notification attention png_bg" id="note"> <a href="#" class="close"><img src="resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close"  onclick="Close();"/></a>
            <div> 更新失败，请输入完整！</div>
          </div>
            <%} %>    
          <table>
            <thead>
              <tr>
         
            	<th>日期</th>
				<th>男昵称</th>
				<th>女昵称</th>
				<th>男头像</th>
				<th>女头像</th>
				<th>状态</th>
				<th>操作</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6">
                  <div class="bulk-actions align-left">
               
                   </div>
                  <div class="pagination">  </div>
                  <!-- End .pagination -->
                  <div class="clear"></div>
                </td>
              </tr>
            </tfoot>
            <tbody id="tab">
            	  <% 
                      if (xnl != null)
                      {
                         
                          foreach (System.Xml.XmlNode xnf in xnl)
                          { 
                              %>
			
         
              <tr>
                <td><%= xnf.Attributes["date"].Value%></td>
                <td><%=  xnf.Attributes["BoyName"].Value%></td>
                <td><%= xnf.Attributes["GirlName"].Value%></td>
                <td><img src="..\<%=  xnf.Attributes["BoyImage"].Value%>" width="40" height="40"/></td>
                <td><img src="..\<%=  xnf.Attributes["GirlImage"].Value%>" width="40" height="40"/></td>
                <td><%=xnf.Attributes["State"].Value%></td>
                <td>
                  <!-- Icons -->
                  <a href="#" title="Edit"><img src="resources/images/icons/pencil.png" alt="修改" onclick="edit('<%= xnf.Attributes["date"].Value%>','<%=  xnf.Attributes["BoyName"].Value%>','<%=xnf.Attributes["GirlName"].Value%>','<%=  xnf.Attributes["BoyImage"].Value%>','<%= xnf.Attributes["GirlImage"].Value%>','<%=xnf.Attributes["State"].Value%>','<%=xnf.Attributes["name"].Value%>');" /></a> <a href="#" onclick="if(confirm('确认删除吗？')){location.href='?delete=yes&id=<%=xnf.Attributes["name"].Value%>';
}"   title="Delete"><img src="resources/images/icons/cross.png" alt="删除" /></a> <a href="#" title="Edit Meta" onclick="add();"><img src="resources/images/icons/hammer_screwdriver.png" alt="添加"  /></a> </td>
              </tr>
              
              <%}
            }%>
             
       
          
           
            </tbody>
          </table>
        </div>
        <!-- End #tab1 -->
        <div class="tab-content" id="tab2">
            <fieldset>
            <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
            <p>
              <label>日期</label>
              <input class="text-input small-input" type="text" id="date-input"   name="date-input" />
             <!-- <span class="input-notification success png_bg">Successful message</span>-->
              <!-- Classes for input-notification: success, error, information, attention -->
              <br />
              <small>如:12月09日</small> </p>
            <p>
              <label>男昵称</label>
              <input class="text-input small-input datepicker" type="text" id="BoyName-input" name="BoyName-input" />
             <!-- <span class="input-notification error png_bg">Error message</span> </p>-->
                <br />
               </p>
            <p>
              <label>女昵称</label>
              <input class="text-input small-input" type="text" id="GirlName-input" name="GirlName-input" />
            </p>
             <p>
              <label>状态</label>
              <input class="text-input small-input" type="text" id="State-input" name="State-input" />
            </p>
             <p>
              <label>女头像(最佳尺寸：40×40)</label>
                  <label id="uploadbox"></label><label id="txtContent"></label><label id="HiddenContent"></label>
             </p>
            <p>
               <p>
              <label>男头像(最佳尺寸：40×40)</label>
                  <label id="uploadbox2"></label><label id="txtContent2"></label><label id="HiddenContent2"></label>
             </p>
            <p>
              <input type="hidden" id="name" name="name" value="" /> 
              <input id="Button1" class="button" type="button" value="提交" runat="server" onserverclick="EditContent"/>
            </p>
      
            </fieldset>
            <div class="clear"></div>
            <!-- End .clear -->
        </div>
        <!-- End #tab2 -->
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->
   

    <div id="footer"> <small>
      <!-- Remove this notice or replace it with whatever you want -->
      &#169; Copyright 2011 9158.Com | Powered by <a href="http://www.9158.com" target="_blank">9158.Com</a> | <a href="#">Top</a> </small> </div>
    <!-- End #footer -->
  </div>
  <!-- End #main-content -->
</div>
</form>
</body>
<script type="text/javascript">

      document.getElementById("tab2").style.display="none";
   var table=document.getElementById("tab");
       for(i=0;i<table.rows.length;i++)
       {
       if(i%2==0)
        {
            table.rows[i].className="alt-row";
            
         
        }       
       }  

    function edit(date,BoyName,GirlName,BoyImage,GirlImage,State,name)
    {
   Style();
        document.getElementById("name").value=name;
       document.getElementById("gototab2").innerText="修改";
       document.getElementById("date-input").value=date;
       document.getElementById("BoyName-input").value=BoyName;
       document.getElementById("GirlName-input").value=GirlName;
       document.getElementById("State-input").value=State;
       document.getElementById("txtContent2").innerHTML="  <img src=\""+"../"+BoyImage+"\" onload=\"if(this.width>40){this.width=40;}\" />";
       document.getElementById("txtContent").innerHTML="  <img src=\""+"../"+GirlImage+"\" onload=\"if(this.width>40){this.width=40;}\" />";
        document.getElementById("HiddenContent2").innerHTML= "<input type='hidden' name='BoyImages' id='BoyImages' value='"+BoyImage+"' />";
         document.getElementById("HiddenContent").innerHTML= "<input type='hidden' name='GirlImages' id='GirlImages' value='"+GirlImage+"' />";
     
       
    }
    function add()
    {
        Style();
       document.getElementById("name").value=""; 
       document.getElementById("gototab2").innerText="添加";
        document.getElementById("date-input").value="";
       document.getElementById("BoyName-input").value="";
       document.getElementById("GirlName-input").value="";
       document.getElementById("State-input").value="";
       document.getElementById("txtContent2").innerHTML="";
       document.getElementById("txtContent").innerHTML="";
       document.getElementById("HiddenContent2").innerHTML= "";
       document.getElementById("HiddenContent").innerHTML= "";
      
     
    }
      
    function Style()
    {
      document.getElementById("tab1").style.display="none";
       document.getElementById("tab2").style.display="block";   
        document.getElementById("gototab1").className="default-tab";
       document.getElementById("gototab2").className="current";
    }
    
    function Defaule()
    { 
       document.getElementById("gototab2").innerText="添加";
       document.getElementById("tab2").style.display="none";
       document.getElementById("tab1").style.display="block";   
       document.getElementById("gototab2").className="default-tab";
       document.getElementById("gototab1").className="current";
           document.getElementById("name").value=""; 
        document.getElementById("date-input").value="";
       document.getElementById("BoyName-input").value="";
       document.getElementById("GirlName-input").value="";
       document.getElementById("State-input").value="";
       document.getElementById("txtContent2").innerHTML="";
       document.getElementById("txtContent").innerHTML="";
       document.getElementById("HiddenContent2").innerHTML= "";
       document.getElementById("HiddenContent").innerHTML= "";

    }
    function Close()
    {
       document.getElementById("note").style.display="none";
    
    }

</script>
<!-- Download From www.exet.tk-->
</html>
